{% extends 'basepl.html' %}
{% load static %}

{% block head %}
<title>成绩管理</title>
<script src="{% static '/jquery.min.js' %}"></script>
<script>
    function getopt(id) {

        var opt=document.getElementById(id).innerHTML;
        $.get("chengji/select",{'opt':opt});
    }
</script>

    <style>
    #t1{
        border: dodgerblue double;
    }
    #grades{
        border: dodgerblue double;
    }
    input{
        width: 110px;
    }
     #plshow{
        position: absolute;
        padding-right:10px;
        overflow-y:auto;
        padding-left:10px;
        SCROLLBAR-FACE-COLOR:#ffffff;
        font-size:11pt;
        padding-bottom:0;
        scrollbar-highlight-color:#ffffff;
        scrollbar-shadow-color:#919192;
        color:black;
        scrollbar-3dlight-color:#ffffff;
        line-height:100%;
        scrollbar-arrow-color:#919192;
        padding-top:0;
        scrollbar-track-color:#ffffff;
        font-family: 宋体;
        scrollbar-darkshadow-color:#ffffff;
        letter-spacing:1pt;
        height:500px;
        width: 480px;
        top: 0;
     }
    </style>
{% endblock head %}
{% block nav %}
 <li><a href="/teaIndex">首页</a></li>
<li><a href="#top">大学课程教学过程管理系统</a></li>
<li><a href="/">切换账号</a></li>
<li><a href="#">&#9658;{{ request.session.cname }}&#9668;</a></li>
<li><a href="#">关于</a></li>
<li><a href="/">注销</a></li>
{% endblock %}
{% block li %}
<li><a href="/teaIndex/teaTask/cdetail">编&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;辑</a></li>
<li><a href="/teaIndex/teaTask/zuoye">作&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;业</a></li>
<li><a href="/teaIndex/teaTask/chengji">成&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;绩</a></li>
<li><a href="/teaIndex/teaTask/detail?val=mingdan">花&nbsp;名&nbsp;册</a></li>
<li><a href="/teaIndex/teaTask/detail?val=chengjidan">成&nbsp;绩&nbsp;
    单</a></li>

{% endblock li %}

{% block section %}
<div id="ly">

    <div id="plshow">

        <form  method = 'post' enctype="multipart/form-data">
                {% csrf_token %}
                    <table id="grades" cellpadding="0"  rules="all">
                        <tr>
                            <td>学号</td>
                            <td>平时成绩</td>
                            <td>考试成绩</td>
                            <td>最终成绩</td>
                        </tr>
                        {% for foo in gra %}
                        <tr>
                            <td><input type="text" name="n{{ foo.snum}}" value=
                                    "{{ foo.snum}}" ></td>
                            <td><input type="text" name="u{{ foo.snum }}" placeholder="请输入平时成绩"></td>
                            <td><input type="text" name="t{{ foo.snum }}" placeholder="请输入考试成绩"></td>
                            <td><input type="text" value="{{ foo.finalgrade }}" ></td>
                        </tr>
                        {% endfor %}
                    </table>
                    <label for="select">请选择占比(平时:考试)：</label>
                    <select name="rate" id="select" >
                        <option id="p1" onclick="getopt(id)" value="1">5:5</option>
                        <option id="p2" onclick="getopt(id)" value="2" >4:6</option>
                        <option id="p3" onclick="getopt(id)" value="3" >3:7</option>
                        <option id="p4" onclick="getopt(id)" value="4" >2:8</option>
                    </select>
                    <input type="submit" value="确定">
        </form>
    </div>
</div>
<div id="gonggao">
    <div id="plshow">
        <table cellpadding="5.5" cellspacing="5" rules="all" id="t1">
            <tr>
                <th>学号</th>
                <th>姓名</th>
                <th>签到次数</th>
                <th>作业平均分</th>
            </tr>
            {% for i in grades %}
                <tr>
                    <td>{{ i.snum }} </td>
                    <td>{{ i.sname }} </td>
                    <td>{{ i.qdcont }} </td>
                    <td>{{ i.zygrades }} </td>
                </tr>
            {% endfor %}
        </table>
    </div>

</div>
{% endblock section %}

{% block qd %}

{% endblock qd %}
